<?php
/**
 * User: b179a9
 * Date: 10/12/11
 * Time: 4:08 PM
 */

class App_Form_User_Password extends Zend_Form
{
    public function init()
    {
        $this->setAction('/user/password');
        $this->setMethod('post');

        $oldPassword = new Zend_Form_Element_Password('oldPassword');
        $oldPassword->setLabel('Old password:')
                ->setRequired();
        $this->addElement($oldPassword);

        $newPassword = new Zend_Form_Element_Password('newPassword');
        $newPassword->setRequired()
                ->setLabel('New password:')
                ->addValidator(new Lib_Form_Validate_InputEquals('newPasswordConfirmation'));
        $this->addElement($newPassword);

        $newPasswordConfirmation = new Zend_Form_Element_Password('newPasswordConfirmation');
        $newPasswordConfirmation->setRequired()
                ->setLabel('New password confirmation');
        $this->addElement($newPasswordConfirmation);

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Update');
        $this->addElement($submit);
    }

}
